package com.ant.ut.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.ant.ut.R;
import com.ant.ut.base.BaseActivity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by baichuan on 2016/12/1.
 */

public class LaunchActivity extends BaseActivity implements AdapterView.OnItemClickListener {

    protected ListView lv;

    protected List<String> slt;
    protected List<Class<? extends Activity>> clt;

    protected ArrayAdapter<String> adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.setContentView(getLaout());
        initView();
        initData();
        initListener();
    }

    @Override
    public int getLaout() {
        slt = new ArrayList<String>();
        clt = new ArrayList<>();
        return R.layout.utl_ac_main;
    }

    @Override
    public void initView() {
        lv = (ListView) findViewById(R.id.utl_ac_main_lv);
    }

    @Override
    public void initData() {
        getListData();
        adapter = new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, slt);
        lv.setAdapter(adapter);
    }

    @Override
    public void initListener() {
        lv.setOnItemClickListener(this);
    }


    public void getListData() {

    }

    @Override
    public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
        startActivity(new Intent(this, clt.get(i)));
    }
}
